package com.mazaiting.blog.service

import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.autoconfigure.EnableAutoConfiguration
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringRunner

@RunWith(SpringRunner::class)
@EnableAutoConfiguration
@SpringBootTest
class ArticleServiceTest {
    @Autowired
    private lateinit var service: ArticleService

    @Test
    fun create() {
        val msg = service.create("", "", "")
        println(msg)
    }

    @Test
    fun create1() {
        val msg = service.create("linghaoyu", "", "")
        println(msg)
    }

    @Test
    fun create2() {
        val msg = service.create("linghaoyu", "", "ceshi")
        println(msg)
    }

    @Test
    fun create3() {
        val msg = service.create("linghaoyu", "Android", "AndroidTest")
        println(msg)
    }

    @Test
    fun update() {
        val msg = service.update("linghaoyu", "Android", "AndroidTest",
                "sdflkasdjflalksdjflkasdjflkasdjlfkajslkfjasdlk \n## kljlsdf")
        println(msg)
    }

    @Test
    fun articleList() {
        val list = service.articleList("linghaoyu")
        println(list)
    }

    @Test
    fun articleListById() {
        val list = service.articleList("linghaoyu", "Android")
        println(list)
    }

}